import request from '@/config/axios'

// 样本来源 VO
export interface JkResourceVO {
  id: number // id
  name: string // 来源名称
}

// 样本来源 API
export const JkResourceApi = {
  // 查询样本来源分页
  getJkResourcePage: async (params: any) => {
    return await request.get({ url: `/jikong/jk-resource/page`, params })
  },

  getJkResourceList: async (params: any) => {
    return await request.get({ url: `/jikong/jk-resource/simple-list`, params })
  },

  // 查询样本来源详情
  getJkResource: async (id: number) => {
    return await request.get({ url: `/jikong/jk-resource/get?id=` + id })
  },

  // 新增样本来源
  createJkResource: async (data: JkResourceVO) => {
    return await request.post({ url: `/jikong/jk-resource/create`, data })
  },

  // 修改样本来源
  updateJkResource: async (data: JkResourceVO) => {
    return await request.put({ url: `/jikong/jk-resource/update`, data })
  },

  // 删除样本来源
  deleteJkResource: async (id: number) => {
    return await request.delete({ url: `/jikong/jk-resource/delete?id=` + id })
  },

  // 导出样本来源 Excel
  exportJkResource: async (params) => {
    return await request.download({ url: `/jikong/jk-resource/export-excel`, params })
  }
}
